import sys

def main():
    print "Please give a command \'a\' for add or \'q\' for queries or \'e\' for exit. \n"
    while 1==1:
        command=raw_input()
        if command=='e':
            return
        command=command.split()
        if command[0]=='a':
            for i in range(len(command)-1):
                index(command[i+1])
        if command[0]=='q':
            search(command[1:])
    return


def index(file):
    print file
    return

def  search(queries):
    print queries
    return


if __name__ == "__main__":
    main()